arm: Consistently use proper interworking function returns
authorMartin Storsjö <martin@martin.st>
Thu, 3 Oct 2024 21:30:24 +0000 (00:30 +0300)
committerSebastian Ramacher <sramacher@debian.org>
Fri, 21 Feb 2025 12:16:27 +0000 (13:16 +0100)
Use "bx lr", or "pop {lr}", which do proper mode switching
between thumb and arm modes. A plain "mov pc, lr" does not switch
from thumb mode to arm mode (while in arm mode, it does switch
mode for a thumb caller).

This is normally not an issue, as CONFIG_THUMB only is enabled if
the C compiler defaults to thumb; but stick to patterns that can
do mode switching if needed, for consistency.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 77e6293735262b20a86b5047b77991a86cf4e9e1)

Gbp-Pq: Name 0008-arm-Consistently-use-proper-interworking-function-re.patch

libswresample/arm/resample.S
libswscale/arm/hscale.S
libswscale/arm/output.S
libswscale/arm/yuv2rgb_neon.S

index 3ce7623246ad458e88f47901868761e8a5dcb97a..791f4cc0167c4ccb03728b2ccbd907f9a19e044e 100644 (file)
@@ -30,7 +30,7 @@ function ff_resample_common_apply_filter_x4_float_neon, export=1
     vpadd.f32           d0, d0, d1                                     @ pair adding of the 4x32-bit accumulated values
     vpadd.f32           d0, d0, d0                                     @ pair adding of the 4x32-bit accumulator values
     vst1.32             {d0[0]}, [r0]                                  @ write accumulator
-    mov pc, lr
+    bx                  lr
 endfunc
 
 function ff_resample_common_apply_filter_x8_float_neon, export=1
@@ -46,7 +46,7 @@ function ff_resample_common_apply_filter_x8_float_neon, export=1
     vpadd.f32           d0, d0, d1                                     @ pair adding of the 4x32-bit accumulated values
     vpadd.f32           d0, d0, d0                                     @ pair adding of the 4x32-bit accumulator values
     vst1.32             {d0[0]}, [r0]                                  @ write accumulator
-    mov pc, lr
+    bx                  lr
 endfunc
 
 function ff_resample_common_apply_filter_x4_s16_neon, export=1
@@ -59,7 +59,7 @@ function ff_resample_common_apply_filter_x4_s16_neon, export=1
     vpadd.s32           d0, d0, d1                                     @ pair adding of the 4x32-bit accumulated values
     vpadd.s32           d0, d0, d0                                     @ pair adding of the 4x32-bit accumulator values
     vst1.32             {d0[0]}, [r0]                                  @ write accumulator
-    mov pc, lr
+    bx                  lr
 endfunc
 
 function ff_resample_common_apply_filter_x8_s16_neon, export=1
@@ -73,5 +73,5 @@ function ff_resample_common_apply_filter_x8_s16_neon, export=1
     vpadd.s32           d0, d0, d1                                     @ pair adding of the 4x32-bit accumulated values
     vpadd.s32           d0, d0, d0                                     @ pair adding of the 4x32-bit accumulator values
     vst1.32             {d0[0]}, [r0]                                  @ write accumulator
-    mov pc, lr
+    bx                  lr
 endfunc
index dd4d45395757f1a8b6fbbe8d52e06fc5d1eab7d9..5c3551a0f19f0cb35650de18180a36dd5d68d3c1 100644 (file)
@@ -65,6 +65,5 @@ function ff_hscale_8_to_15_neon, export=1
     subs                r2, #2                                         @ dstW -= 2
     bgt                 1b                                             @ loop until end of line
     vpop                {q4-q7}
-    pop                 {r4-r12, lr}
-    mov pc, lr
+    pop                 {r4-r12, pc}
 endfunc
index 70846dee1f1de6eab16da92bab2714ef65c35b4f..5f10585f81911db41a5169da46561e8aa5fe29cb 100644 (file)
@@ -73,6 +73,5 @@ function ff_yuv2planeX_8_neon, export=1
     subs                r4, r4, #8                                     @ dstW -= 8
     bgt                 2b                                             @ loop until width is consumed
     vpop                {q4-q7}
-    pop                 {r4-r12, lr}
-    mov                 pc, lr
+    pop                 {r4-r12, pc}
 endfunc
index 474465427d6fa281abaf34f09d7dd0488050f447..6777d625f980dafd68d4b9e6860fff19092ea9d8 100644 (file)
@@ -262,8 +262,7 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
     increment_and_test_\ifmt
     bgt                 1b
     vpop                {q4-q7}
-    pop                 {r4-r12, lr}
-    mov                 pc, lr
+    pop                 {r4-r12, pc}
 endfunc
 .endm